﻿using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using GalaSoft.MvvmLight.Command;
using GalaSoft.MvvmLight.Messaging;
using Bymed.SpineScan.Service.Shared;
using Bymed.SpineScan.WPF.Model;
using Bymed.SpineScan.WPF.Shared;
using System;

namespace Bymed.SpineScan.WPF.ViewModel
{
    public class PatientBasicInfoBaseViewModel : MyViewModelBase
    {
        public GeneralUtility.Gender Gender { get; private set; }

        /// <summary>
        /// Initializes a new instance of the PatientBasicInfoBaseViewModel class.
        /// </summary>
        public PatientBasicInfoBaseViewModel(IDataService dataService)
            : base(dataService)
        {
            IsNewData = true;
            Gender = GeneralUtility.Gender.Male;
        }

        /// <summary>
        /// The <see cref="IsNewData" /> property's name.
        /// </summary>
        public const string IsNewDataPropertyName = "IsNewData";

        private bool _isNewData = true;

        /// <summary>
        /// Sets and gets the IsNewData property.
        /// Changes to that property's value raise the PropertyChanged event. 
        /// </summary>
        public bool IsNewData
        {
            get
            {
                return _isNewData;
            }

            set
            {
                if (_isNewData == value)
                {
                    return;
                }

                RaisePropertyChanging(IsNewDataPropertyName);
                _isNewData = value;
                RaisePropertyChanged(IsNewDataPropertyName);
            }
        }

        /// <summary>
        /// The <see cref="Number" /> property's name.
        /// </summary>
        public const string NumberPropertyName = "Number";

        private string _number = string.Empty;

        /// <summary>
        /// Sets and gets the Number property.
        /// Changes to that property's value raise the PropertyChanged event. 
        /// </summary>
        public string Number
        {
            get
            {
                return _number;
            }

            set
            {
                if (_number == value)
                {
                    return;
                }

                RaisePropertyChanging(NumberPropertyName);
                _number = value;
                RaisePropertyChanged(NumberPropertyName);
            }
        }

        /// <summary>
        /// The <see cref="Name" /> property's name.
        /// </summary>
        public const string NamePropertyName = "Name";

        private string _name = string.Empty;

        /// <summary>
        /// Sets and gets the Name property.
        /// Changes to that property's value raise the PropertyChanged event. 
        /// </summary>
        public string Name
        {
            get
            {
                return _name;
            }

            set
            {
                if (_name == value)
                {
                    return;
                }

                RaisePropertyChanging(NamePropertyName);
                _name = value;
                RaisePropertyChanged(NamePropertyName);
            }
        }

        /// <summary>
        /// The <see cref="IsMale" /> property's name.
        /// </summary>
        public const string IsMalePropertyName = "IsMale";

        private bool _isMale = true;

        /// <summary>
        /// Sets and gets the IsMale property.
        /// Changes to that property's value raise the PropertyChanged event. 
        /// </summary>
        public bool IsMale
        {
            get
            {
                return _isMale;
            }

            set
            {
                if (_isMale == value)
                {
                    return;
                }

                RaisePropertyChanging(IsMalePropertyName);
                _isMale = value;
                RaisePropertyChanged(IsMalePropertyName);

                Gender = _isMale ? GeneralUtility.Gender.Male : GeneralUtility.Gender.Female;
            }
        }

        /// <summary>
        /// The <see cref="IsFemale" /> property's name.
        /// </summary>
        public const string IsFemalePropertyName = "IsFemale";

        private bool _isFemale = false;

        /// <summary>
        /// Sets and gets the IsFemale property.
        /// Changes to that property's value raise the PropertyChanged event. 
        /// </summary>
        public bool IsFemale
        {
            get
            {
                return _isFemale;
            }

            set
            {
                if (_isFemale == value)
                {
                    return;
                }

                RaisePropertyChanging(IsFemalePropertyName);
                _isFemale = value;
                RaisePropertyChanged(IsFemalePropertyName);

                Gender = _isFemale ? GeneralUtility.Gender.Female : GeneralUtility.Gender.Male;
            }
        }

        /// <summary>
        /// The <see cref="Birthday" /> property's name.
        /// </summary>
        public const string BirthdayPropertyName = "Birthday";

        private DateTime? _birthday = null;

        /// <summary>
        /// Sets and gets the Birthday property.
        /// Changes to that property's value raise the PropertyChanged event. 
        /// </summary>
        public DateTime? Birthday
        {
            get
            {
                return _birthday;
            }

            set
            {
                if (_birthday == value)
                {
                    return;
                }

                RaisePropertyChanging(BirthdayPropertyName);
                _birthday = value;
                RaisePropertyChanged(BirthdayPropertyName);
            }
        }

        /// <summary>
        /// The <see cref="Height" /> property's name.
        /// </summary>
        public const string HeightPropertyName = "Height";

        private string _height = null;

        /// <summary>
        /// Sets and gets the Height property.
        /// Changes to that property's value raise the PropertyChanged event. 
        /// </summary>
        public string Height
        {
            get
            {
                return _height;
            }

            set
            {
                if (_height == value)
                {
                    return;
                }

                RaisePropertyChanging(HeightPropertyName);
                _height = value;
                RaisePropertyChanged(HeightPropertyName);
            }
        }

        /// <summary>
        /// The <see cref="Weight" /> property's name.
        /// </summary>
        public const string WeightPropertyName = "Weight";

        private string _weight = null;

        /// <summary>
        /// Sets and gets the Weight property.
        /// Changes to that property's value raise the PropertyChanged event. 
        /// </summary>
        public string Weight
        {
            get
            {
                return _weight;
            }

            set
            {
                if (_weight == value)
                {
                    return;
                }

                RaisePropertyChanging(WeightPropertyName);
                _weight = value;
                RaisePropertyChanged(WeightPropertyName);
            }
        }

        /// <summary>
        /// The <see cref="Remark" /> property's name.
        /// </summary>
        public const string RemarkPropertyName = "Remark";

        private string _remark = string.Empty;

        /// <summary>
        /// Sets and gets the Remark property.
        /// Changes to that property's value raise the PropertyChanged event. 
        /// </summary>
        public string Remark
        {
            get
            {
                return _remark;
            }

            set
            {
                if (_remark == value)
                {
                    return;
                }

                RaisePropertyChanging(RemarkPropertyName);
                _remark = value;
                RaisePropertyChanged(RemarkPropertyName);
            }
        }

        /// <summary>
        /// The <see cref="CreateDateDisplay" /> property's name.
        /// </summary>
        public const string CreateDateDisplayPropertyName = "CreateDateDisplay";

        private string _createDateDisplay = string.Empty;

        /// <summary>
        /// Sets and gets the CreateDateDisplay property.
        /// Changes to that property's value raise the PropertyChanged event. 
        /// </summary>
        public string CreateDateDisplay
        {
            get
            {
                return _createDateDisplay;
            }

            set
            {
                if (_createDateDisplay == value)
                {
                    return;
                }

                RaisePropertyChanging(CreateDateDisplayPropertyName);
                _createDateDisplay = value;
                RaisePropertyChanged(CreateDateDisplayPropertyName);
            }
        }
    }
}
